# 初始资源情况
cash = 211
supply = 50
income = 88
tech_points = 14
economy_factor = 0.7

# 工厂信息
factories = {
    "material_factory": {"cost": 300, "build_time": 60, "income_rate": 16},
    "advanced_factory": {"cost": 240, "build_time": 50, "income_rate": 36},
    "modern_factory": {"cost": 240, "build_time": 50, "income_rate": 60}
}

# 大学信息
university = {"cost": 160, "supply": 2, "build_time": 60, "tech_point_rate": 2}

# 物流仓库信息
warehouse = {"cost": 100, "build_time": 30, "supply": 40}

# 政策信息
policies = {
    "minimal_education_investment": {"cash_increase": 0.15, "tech_point_decrease": 0.33},
    "average_education_investment": {"cash_increase": 0, "tech_point_decrease": 0},
    "massive_education_investment": {"cash_increase": -0.3, "tech_point_increase": 0.33}
}

# 城市工厂可选项
city_options = {
    "city1": ["light_factory", "university", "warehouse"],
    "city2": ["light_factory", "university", "warehouse"],
    "city3": ["light_factory", "university", "warehouse"],
    "city4": ["material_factory", "university", "warehouse"],
    "city5": ["light_factory", "university", "warehouse"],
    "city6": ["material_factory", "university", "warehouse"],
    "city7": ["light_factory", "university", "warehouse"],
    "city8": ["light_factory", "university", "warehouse"]
}


def build_factory(factory_type, city):
    global cash, supply, income
    if factory_type == "light_factory":
        cash -= 160
        supply -= 4
        income += 8
        print(f"在{city}建造了轻工厂")
    elif factory_type == "material_factory":
        cash -= 300
        supply -= 5
        income += 16
        print(f"在{city}建造了材料厂")
    # 其他工厂类型的逻辑


def build_university(city):
    global cash, supply, tech_points
    cash -= 160
    supply -= 2
    tech_points += 2
    print(f"在{city}建造了大学")


def build_warehouse(city):
    global cash, build_time
    cash -= 100
    build_time -= 30
    print(f"在{city}建造了物流仓库")


# 达到最大现金收入所需的时间
max_cash_income = 20000
time = 0
while cash < max_cash_income:
    time += 1
    # 根据当前资源情况计算收入
    total_income = income * (1 + economy_factor)

    # 更新资源情况
    cash += total_income
    tech_points += 14  # 假设每轮增加固定的科技点

    # 假设每轮建造一个工厂/大学/仓库
    # 这里需要根据条件来选择建造的项目，并更新资源情况
    if condition:
        build_factory("light_factory", "city1")
    # 根据其他条件选择建造的项目

# 输出结果
print("达到最大现金收入（20000）所需的时间为：", time)
print("建造的工厂、材料厂、大学、物流仓库数量以及政策切换情况如下：")
# 输出具体的建造情况
